<template>
  <div class="Downss">
    <van-nav-bar left-text="返回" title="App下载" left-arrow fixed @click-left="onClickLeft" />
    <van-row type="flex" class="nav-icon" >
      <van-col span="24">
        <div class="note-bg" ref ='notebg'>
          <img :src="bg_url" class="iconlogo" />
        </div>
      </van-col>
    </van-row>
    <!-- <div class="note-autor"> -->
        <!-- <span :style="{ marginLeft: marginleft + 'px' }" ref ='noteautor'>sss</span> -->
        <!-- <span :style="{ marginLeft: marginleft + 'px' }" ref ='noteautor'>sss</span> -->
    <!-- </div> -->
    <van-row class="Down">
        <van-col span="12" v-for="(item,index) in DownArry" :key="index" >
          <img :src="item.urlIcon" class="icon" />
          <span>{{item.version}}</span>
          <span class="linkname"><a :href="item.url" download >{{item.linkName}}</a></span>
        </van-col>
    </van-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      name: this.name, //姓名
      EmpRoleName: this.EmpRoleName, //职位
      EmpDepName: this.EmpDepName, //部门
      EmpStatus: this.EmpStatus, //状态
      EmpPhoneNum1: this.EmpPhoneNum1, //
      sex: this.sex,
      lefts:'',
      title:'',
      marginleft:'',
      bg_url: require("@/assets/Image/bgurl.png"),
      Center_url: require("@/assets/Image/Personal _Center.png"),
      DownArry:''
    };
  },
  methods: {
    //返回上一个页面
    onClickLeft() {
      this.$router.go(-1);
    },

    // //跳转
    
    // upload() {
    //   this.$router.push("/AddList");
    // },

    //跳转到页面

    // saveVideo() {
    //   this.$router.push("/VideoList");
    // },

    //获取某个用户的所有评论或回复
    GetDownloadApp() {
      // const PWD = JSON.parse(sessionStorage.getItem("PWD"));
      this.$axios({
        method: "get",
        url: "/api/User/GetDownloadApp",
        // headers: {sessionKey:PWD.sessionKey,authorization:PWD.token},
        // data: {
        //   pageIndex: 1,//获取或设置 当前页码。
        //   pageSize: 20,//获取或设置 每页显示数据量。
        //   recordCount:30//获取或设置 所有符合查询条件的总数据量。
        // }
      })
        .then(res => {
            console.log(res);
          if (res.status === 200 ) {
              this.DownArry = res.data;
              console.log(window.location.href);
              let LocaUrl = window.location.href.split('/#/');
              // console.log(ss);and
              this.DownArry[0].url = LocaUrl[0]+'/' + 'android_fuyin.apk';
              this.DownArry[1].url = LocaUrl[0]+'/' + 'ios_fuyin.ipa';
              console.log(this.DownArry);
            // console.log('s');
            // console.log(res.data.data.resultList)
            
            // for (var i = 0; i < res.data.data.resultList.length; i++) {
            //      res.data.data.resultList[i].Time = new Date(res.data.data.resultList[i].lastAnswerTime).toLocaleDateString();
            //      this.messageList = res.data.data.resultList;
            // }
          }
          if (res.data.code == 1) {
            this.$toast({
              duration: 800,
              message: res.data.Message
            });
          }
        })
        .catch(err => {
          console.log(err);
        });
    },

  },
  mounted(){
    //console.log(this.$refs.notebg.offsetWidth);
    //计算页面的logo的偏移值
    //this.lefts =( this.$refs.notebg.offsetWidth - 50 ) / 2;
    //console.log(this.$refs.noteautor.offsetWidth);
    //计算页面的title的marginleft
    //this.marginleft = (this.$refs.notebg.offsetWidth  -  this.$refs.noteautor.offsetWidth ) / 2 + 5;
    //console.log(this.marginleft );
    this.GetDownloadApp();
  },
  //初始化页面
  created() {
    
    // this.title = JSON.parse(sessionStorage.getItem('PWD')).userName;
    this.$emit("header", false);
    this.$emit("footer", false);
  }
};
</script>

<style lang="less" scoped>
.Downss{
   background-color: #fff;
   height: 100%;
   width: 100%;
}

.item {
  background-color: #fff;
  text-align: center;
  height: 50px;
  margin-top: 10px;
  .itemSpan {
    border: 1px solid #eee;
    span {
      font-size: 14px;
      line-height: 50px;
      border: 1px solid #eee;
    }
    // margin-left: ;
  }
}
.itemupload{
  background-color: #fff;
  text-align: center;
  height: 50px;
  margin-top: 10px;
   span {
      font-size: 14px;
      line-height: 50px;
      border: 1px solid #eee;
    }
    .ss{
      //  text-align: left;
      float: left;
      margin-left: 20px;
    }
}

.note-bg {
  img {
    width: 100%;
    height:100%;
  }
}

.note-icon{
  text-align:center;
}
.nav_logo{
    position: absolute;
    // top: 50;
    top: 120px;
    left: 150px;
      // text-align: center;
    width: 50px;
    background-color: #fff;
    border: 5px solid #fff;
    border-radius: 50%;
}

.note-autor{
   position: absolute;
   top: 180px;
   margin-top: 20px;
  // margin-left: 160px;
  span{
    font-size: 20px;
    letter-spacing: 2px;
    color: #fff;
    
  }
}

.Down{
    // height: 50px;
    text-align: center;
    margin-top: 50px;
    margin-bottom: 10px;
    span{
       // line-height: 50px;
       font-size: 14px;
       text-align: center; 
       //background-color:brown;
       //padding: 10px;
       // color: #000;
       border-radius:10px ;
       display: block;
       margin-top: 20px;
    }
    .linkname a{
        color: red;
      
    }
}
</style>


